package com.itlong.cloud.user.property;

import com.itlong.cloud.POJO.DTO.BaseDTO;
import com.itlong.cloud.POJO.DTO.operate.OperateWeChatDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyWeChatDTO;
import com.itlong.cloud.POJO.PO.WeChatOfficialAuthInfoPO;
import com.itlong.cloud.POJO.VO.operate.OperateWeChatVO;
import com.itlong.cloud.POJO.VO.property.PropertyWeChatVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      物业-微信支付相关暴露接口
 * </desc>
 *
 * @createDate 2019/09/09
 */
@FeignClient(name = "user-service")
public interface IPropertyWeChatServiceClient {

    /**
     * <desc>
     *      获取用户授权的appId
     * </desc>
     *
     * @return 用户授权的appId
     * @author wangzhi
     * @createDate 2019/09/09
     */
    @PostMapping(path = "property/weChat/getAppId")
    List<Map<String,Object>> getAppId(@RequestBody BaseDTO baseDTO) throws Exception;

    /**
     * <desc>
     *      添加appId对应商户号
     * </desc>
     *
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2019/09/10
     */
    @PostMapping(path = "property/weChat/saveMchId")
    Integer saveMchId(@RequestBody PropertyWeChatDTO propertyWeChatDTO) throws Exception;

    /**
     * <desc>
     *      分页查询appId和商户号信息
     * </desc>
     *
     * @return 分页数据信息
     * @author wangzhi
     * @createDate 2019/09/10
     */
    @PostMapping(path = "property/weChat/getMchIdPage")
    Page<PropertyWeChatVO> getMchIdPage(@RequestBody PropertyWeChatDTO propertyWeChatDTO) throws Exception;

    /**
     * <desc>
     *      保存微信公众号授权信息
     * </desc>
     *
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2019/09/10
     */
    @PostMapping(path = "property/weChat/saveWeChatAuthInfoCallBack")
    Integer saveWeChatAuthInfoCallBack(@RequestBody WeChatOfficialAuthInfoPO weChatOfficialAuthInfoPO) throws Exception;

    /**
     * <desc>
     *      获取公众号列表
     * </desc>
     *
     * @return 公众号列表
     * @author wangzhi
     * @createDate 2019/10/21
     */
    @PostMapping(path = "property/weChat/getAppIdPage")
    Page<PropertyWeChatVO> getAppIdPage(@RequestBody BaseDTO baseDTO) throws Exception;

    /**
     * <desc>
     *      查看用户授权
     * </desc>
     *
     * @return 用户授权信息
     * @author wangzhi
     * @createDate 2019/10/21
     */
    @PostMapping(path = "property/weChat/getOneAppId")
    PropertyWeChatVO getOneAppId(@RequestBody PropertyWeChatDTO propertyWeChatDTO) throws Exception;

    /**
     * <desc>
     *      解除微信公众号绑定
     * </desc>
     *
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2019/10/21
     */
    @PostMapping(path = "property/weChat/deleteAppIdBinding")
    Integer deleteAppIdBinding(@RequestBody PropertyWeChatDTO propertyWeChatDTO) throws Exception;

    /**
     * <desc>
     *      修改appId对应商户号
     * </desc>
     *
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2019/10/22
     */
    @PostMapping(path = "property/weChat/updateMchId")
    Integer updateMchId(@RequestBody PropertyWeChatDTO propertyWeChatDTO) throws Exception;

    /**
     * <desc>
     *      解除商户号绑定
     * </desc>
     *
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2019/10/22
     */
    @PostMapping(path = "property/weChat/deleteMchIdBinding")
    Integer deleteMchIdBinding(@RequestBody PropertyWeChatDTO propertyWeChatDTO) throws Exception;

    /**
     * <desc>
     *      查询开通微信支付的所有项目及详细信息
     * </desc>
     *
     * @return 开通微信支付的所有项目及详细信息
     * @author wangzhi
     * @createDate 2019/10/23
     */
    @PostMapping(path = "operate/weChat/getWeChatPayPage")
    Page<OperateWeChatVO> getWeChatPayPage(@RequestBody OperateWeChatDTO operateWeChatDTO) throws Exception;

    /**
     * <desc>
     *      添加公众号AppSecret
     * </desc>
     *
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2019/11/05
     */
    @PostMapping(path = "operate/weChat/saveAppSecret")
    Integer saveAppSecret(@RequestBody PropertyWeChatDTO propertyWeChatDTO) throws Exception;
}
